//package com.lyt.springboot.controller;
//
//import com.lyt.springboot.service.KafkaProducer;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RestController;
//
//@RestController
//public class KafkaController {
//
//    private final KafkaProducer kafkaProducer;
//
//    public KafkaController(KafkaProducer kafkaProducer) {
//        this.kafkaProducer = kafkaProducer;
//    }
//
//    @PostMapping("/send")
//    public String sendMessage(@RequestBody String message) {
//        kafkaProducer.sendMessage(message);
//        return "Message sent: " + message;
//    }
//}